Creating a C1LinearGauge control in code is fairly simple. In the following steps you'll add a PlaceHolder control to the page, add an import statement, add and customize the C1LinearGauge, and add the control to the PlaceHolder.
Complete the following steps:
To write the code in Visual Basic:
Visual Basic |
Copy Code
|
---|---|
Imports C1.Web.Wijmo.Controls.C1Gauge |
To write the code in C#:
C# |
Copy Code
|
---|---|
using C1.Web.Wijmo.Controls.C1Gauge; |
To write the code in Visual Basic:
Visual Basic |
Copy Code
|
---|---|
' Create a new C1LinearGauge. Dim C1LG As New C1LinearGauge ' Set the control's size and value. C1LG.Height = 100 C1LG.Width = 500 C1LG.Min = 0 C1LG.Max = 100 C1LG.Value = 60 ' Add the C1LinearGauge to the PlaceHolder control. Dim PlaceHolder1 As New PlaceHolder PlaceHolder1.Controls.Add(C1LG) form1.Controls.Add(PlaceHolder1) |
To write the code in C#:
C# |
Copy Code
|
---|---|
// Create a new C1LinearGauge. C1LinearGauge C1LG = new C1LinearGauge(); // Set the control's size and value. C1LG.Height = 100; C1LG.Width = 500; C1LG.Min = 0; C1LG.Max = 100; C1LG.Value = 60; // Add the C1LinearGauge to the PlaceHolder control. PlaceHolder PlaceHolder1 = new PlaceHolder(); PlaceHolder1.Controls.Add(C1LG); form1.Controls.Add(PlaceHolder1); |
What You've Accomplished
Run your application and observe that the C1LinearGauge control was created.